package com.afdor.rws.event.support;

import com.afdor.rws.annotation.extension.Extension;
import com.afdor.rws.event.EventSource;
import com.afdor.rws.event.channel.ChannelProvider;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;

/**
 * 事件源配置信息
 *
 * @author 悭梵
 * @date Created in 2018-08-14 18:31
 */
@Getter
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Extension(value = "default", order = Extension.NORMAL_ORDER - 100, scope = Extension.Scope.PROTOTYPE, interfaceClass = EventSource.class)
public class DefaultEventSource implements EventSource<ChannelProvider> {

    @NonNull
    private String eventSourceName;
    @NonNull
    private ChannelProvider channelProvider;

    @Override
    public DefaultEventSource setEventSourceName(@NonNull String eventSourceName) {
        this.eventSourceName = eventSourceName;
        return this;
    }

    @Override
    public DefaultEventSource setChannelProvider(@NonNull ChannelProvider channelProvider) {
        this.channelProvider = channelProvider;
        return this;
    }

}
